
Ext.define('FrontSuite.view.TestForm', {
    extend:       'Ext.form.Panel',    // defines the superclass. results in class inheritance.
    id: 'fieldSetForm',
    collapsible: true,
    url: 'save-form.php',
    frame: true,
    title: 'Simple Form with FieldSets',
    bodyPadding: '5 5 0',
    width: 350,
    fieldDefaults: {
        msgTarget: 'side',
        labelWidth: 75
    },
    defaults: {
        anchor: '100%'
    },

    items: [{
        xtype:'fieldset',
        checkboxToggle:true,
        title: 'User Information',
        defaultType: 'textfield',
        collapsed: true,
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },
        items :[{
            fieldLabel: 'First Name',
            // afterLabelTextTpl: required,
            name: 'first',
            allowBlank:false
        },{
            fieldLabel: 'Last Name',
            // afterLabelTextTpl: required,
            name: 'last'
        },{
            fieldLabel: 'Company',
            name: 'company'
        }, {
            fieldLabel: 'Email',
            // afterLabelTextTpl: required,
            name: 'email',
            vtype:'email'
        }]
    },{
        xtype:'fieldset',
        title: 'Phone Number',
        collapsible: true,
        defaultType: 'textfield',
        layout: 'anchor',
        defaults: {
            anchor: '100%'
        },
        items :[{
            fieldLabel: 'Home',
            name: 'home',
            value: '(888) 555-1212'
        },{
            fieldLabel: 'Business',
            name: 'business'
        },{
            fieldLabel: 'Mobile',
            name: 'mobile'
        },{
            fieldLabel: 'Fax',
            name: 'fax'
        }]
    }],

    buttons: [{
        text: 'Save'
    },{
        text: 'Cancel'
    }]
});
